Skip to content

Implement the measure boxes on the operations - #54

Merged
dannycoulombe merged 2 commits into
BenchUp3D:mainfrom
Jairolaya12x:implement-measure-boxes-on-operations
Nov 13, 2026
Merged

dannycoulombe merged 2 commits into
BenchUp3D:mainfrom
Jairolaya12x:implement-measure-boxes-on-operations

Conversation

@Jairolaya12x

@Jairolaya12x Jairolaya12x commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Typed dimensions are now shown in floating boxes placed on the edge they affect (similar to Fusion 360), instead of only in the status-bar field.

  • Line, circle, polygon, arc chord, move: the box sits on the midpoint of the segment being measured and shows the live value, or the typed text with a caret.
  • Rectangle / image: separate Width and Height boxes on adjacent sides. Tab / Shift+Tab switches fields and selects the value, so typing replaces it. Either side can be left empty to keep the size under the cursor.
    The 5m,50mm syntax still works.
  • Arc height: the box sits on the sagitta (chord midpoint → apex) and shows the actual arc height.
  • Push/Pull: shows the distance; the resulting total depth appears as a second line only for already extruded faces (previously "Difference" and "Total" repeated the same value on fresh faces, and the text was not translated).
  • Freehand, offset, rotate, scale: box next to the cursor.
  • Invalid input turns the box border red.
  • Spaces in dimensions: 2 cm now works like 2cm. While a dimension is being typed, Space and letter keys no longer trigger tool shortcuts. With an empty dimension, Space still switches to Select.

The status-bar field is hidden while floating boxes are enabled. It is still used when the new View → Floating Dimension Input option is turned off (persisted, on by default), and for Tape Measure and Protractor.

Implementation notes

  • New module crates/benchup-app/src/dimension_overlay.rs. The boxes are display-only: typed text already flows into length_input without focus, so a second focusable text field would duplicate input.
  • Rectangle input keeps the existing width,height buffer format, so formulas, the status-bar field and commit logic are unchanged.
  • New translation keys in all catalogs: app.width, app.height, app.push_pull_total, sidebar.floating_dimension_input; updated rectangle hint text.

Tests

Added coverage for Tab/Shift+Tab field switching and selection, single-side rectangle input, invalid sides, input length limit, arc height (sagitta), Push/Pull total, spaces inside dimensions, the hidden status-bar field, and persistence
of the new option.

Screenshot 2026-11-13 155743

@dannycoulombe

Copy link
Copy Markdown
Collaborator

Interesting. I like the idea. Will test it out.

@Jairolaya12x
Jairolaya12x marked this pull request as ready for review November 13, 2026 20:50
@Jairolaya12x

Copy link
Copy Markdown
Contributor Author

For some reason I can't upload the demo on github 😢 https://streamable.com/jdiq4e but here an example of the code working

@dannycoulombe

Copy link
Copy Markdown
Collaborator

For some reason I can't upload the demo on github 😢 https://streamable.com/jdiq4e but here an example of the code working

Oh nice... that look very slick! I am finilizing with another PR and will checkout this one after.

@dannycoulombe
dannycoulombe merged commit f3db364 into BenchUp3D:main Nov 13, 2026
3 checks passed
@dannycoulombe

Copy link
Copy Markdown
Collaborator

Beautiful. The formulas still work. :-)

I made two minor changes:

  1. I hid the caret until the user starts to type because it makes 5cm looks like 15cms (|5cm).
  2. If first typed character is a space, it leaves the tool and goes back to Select.

Otherwise this feature is great. It makes distances much clearer!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants